package com.elm.service.test.impl;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebParam.Mode;
import javax.xml.ws.Holder;
import javax.xml.ws.RequestWrapper;
import javax.xml.ws.ResponseWrapper;

import com.elm.service.test.AppointmentsListResponse;
import com.elm.service.test.BaseService;
import com.elm.service.test.ObjectFactory;
import com.elm.service.test.TransactionContext;
import com.elm.service.test.TransactionContext.Control;
import com.elm.service.test.TransactionContext.Status;

public class BaseServiceImpl implements BaseService {

	@Override
	@RequestWrapper(localName = "appointmentsList", targetNamespace = "http://www.elm.sa/sdp/schemas/common/v1", className = "com.elm.service.test.AppointmentsList")
	@WebMethod(action = "http://www.elm.sa/sdp/schemas/common/v1/appointmentsList")
	@ResponseWrapper(localName = "appointmentsListResponse", targetNamespace = "http://www.elm.sa/sdp/schemas/common/v1", className = "com.elm.service.test.AppointmentsListResponse")
	public void appointmentsList(
			@WebParam(name = "in", targetNamespace = "") String in,
			@WebParam(mode = Mode.INOUT, name = "TransactionContext", targetNamespace = "") Holder<TransactionContext> transactionContext,
			@WebParam(mode = Mode.OUT, name = "out", targetNamespace = "") Holder<String> out) {
		// TODO Auto-generated method stub
		System.out.println("Service Impl");
		ObjectFactory factory=new ObjectFactory();
		TransactionContext context=factory.createTransactionContext();
		Control control=factory.createTransactionContextControl();
		control.setSAccountID("123");
		control.setSUserID("user123");
		context.setControl(control);
		Status status=factory.createTransactionContextStatus();
		status.setSStatus("Success");
		context.setStatus(status);
		AppointmentsListResponse res=factory.createAppointmentsListResponse();
		res.setOut("done");
		res.setTransactionContext(context);

	}

}
